package com.power.sifa.approve.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  审理时限延期记录实体类
*/

@Entity
@ApiModel(value="审理时限延期记录")
@Data
@Table(name="Apl_limdelay_hear",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Apl_limdelay_hear.Apl_limdelay_hearPK.class) 用于复合组件
public class Apl_limdelay_hear extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "applyid+毫秒")
    private String id;

    @ApiModelProperty(value = "申请id")
    private String applyid;

    @ApiModelProperty(value = "原截止日期")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date endtime0;

    @ApiModelProperty(value = "延期天数")
    private Integer daynum;

    @ApiModelProperty(value = "延期至日期")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date enddate1;

    @ApiModelProperty(value = "延期原因")
    private String reason;

    @ApiModelProperty(value = "延期人")
    private String userid;

    @ApiModelProperty(value = "子流程applyid")
    private String sonapplyid;

    @ApiModelProperty(value = "生效日期")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date effdate;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("applyid", this.getApplyid());
        map.put("endtime0", this.getEndtime0());
        map.put("daynum", this.getDaynum());
        map.put("enddate1", this.getEnddate1());
        map.put("reason", this.getReason());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_limdelay_hearPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_limdelay_hearPK pk = (Apl_limdelay_hearPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
